import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: "login",
    }, {
      path: '/login',
      component: () => import('@/views/LoginPage.vue')
    },
    // {
    //   path: '/index',
    //   component: () => import('@/views/IndexPage.vue'),
    //   children: [
    //     {
    //       path: "",
    //       redirect: "/index/products"
    //     },
    //     {
    //       path: 'products',
    //       component: () => import('@/views/ProductsView.vue')
    //     }

    //   ]
    // },
    {
            path: '/products',
      component: () => import('@/views/ProductsView.vue')
    },
    {
      path: '/info',
      component: () => import('@/views/infoView.vue')
    },
    {
      path: '/addproduct',
      component: () => import('@/views/ProductAddVue.vue')
    },
    {
      path: '/shopcart/:custmerid',
      component: () => import('@/views/ShopCartView.vue')
    },
    {
      path: '/ulogin',
      component: () => import('@/views/UserLoginPage.vue'),
    },
    {
      path: '/register',
      component: () => import('@/views/RegisterPage.vue')
    },
     {
      path: '/test',
      component: () => import('@/views/Test.vue')
    },
      {
      path: '/umanage',
      component: () => import('@/views/UManage.vue')
    },
    {
      path: '/order/list',
      component: ()=> import('@/views/OrderListView.vue')
    },
    {
      path: '/listTc',
      component: ()=> import('@/views/listTc.vue')
    },
    {
      path: '/cateadd',
      component: ()=> import('@/views/Cateadd.vue')
    },
    {
      path: '/allorder',
      component: ()=> import('@/views/allorders.vue')
    },
  
  ],

})
export default router
